﻿@model IEnumerable<MvcMovie.Models.Movie>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")

    @using ( Html.BeginForm( "SearchIndex", "Movies", FormMethod.Get ) )
    {   
         <p>Genre: @Html.DropDownList( "movieGenre", "All" )  
           Title: @Html.TextBox( "SearchString" )  
         <input type="submit" value="Filter" /></p>
    }
</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            ReleaseDate
        </th>
        <th>
            Genre
        </th>
        <th>
            Price
        </th>
        <th></th>
    </tr>

@foreach ( var item in Model )
{
    <tr>
        <td>
            @Html.DisplayFor( modelItem => item.Title )
        </td>
        <td>
            @Html.DisplayFor( modelItem => item.ReleaseDate )
        </td>
        <td>
            @Html.DisplayFor( modelItem => item.Genre )
        </td>
        <td>
            @Html.DisplayFor( modelItem => item.Price )
        </td>
        <td>
            @Html.ActionLink( "Edit Me", "Edit", new { id = item.ID } ) |
            @Html.ActionLink( "Details", "Details", new { id = item.ID } ) |
            @Html.ActionLink( "Delete", "Delete", new { id = item.ID } )
        </td>
    </tr>
}

</table>
